﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="STU_List.aspx.cs" Inherits="Web.admin.students.show" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <script src="../../js/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../js/function.js" type="text/javascript"></script>
    <script src="../../js/ajax.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" >
        function check() {
            if ($(".seacheContent").val() == "") {
                alert("搜索内容不允许为空");
                return false;
            }
            else
                return true;
        }
        function checkAdd() {
            if ($("#txt_studentName_add").val() == "") {
                alert("姓名不允许为空");
                return false;
            }
            if ($("#txt_studentCode_add").val() == "") {
                alert("学号不允许为空");
                return false;
            }
            if ($("#txt_studentUsm_add").val() == "") {
                alert("用户名不允许为空");
                return false;
            }
            if ($("#txt_studentPwd_add").val() == "") {
                alert("密码不允许为空");
                return false;
            }
            if ($("#txt_studentPwd_add").val() == "") {
                alert("年级不允许为空");
                return false;
            }
            else
                return true;
        }
        function checkedit() {
            if ($("#txt_studentName_edit").val() == "") {
                alert("姓名不允许为空");
                return false;
            }
            if ($("#txt_studentCode_edit").val() == "") {
                alert("学号不允许为空");
                return false;
            }
            if ($("#txt_studentUsm_edit").val() == "") {
                alert("用户名不允许为空");
                return false;
            }
            if ($("#txt_studentPwd_edit").val() == "") {
                alert("密码不允许为空");
                return false;
            }
            if ($("#txt_studentGrade_edit").val() == "") {
                alert("年级不允许为空");
                return false;
            }
            else
                return true;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="top_div">
        <div class="top_div_left" >
                <table>
                    <tr >
                        <td ><img src="../../images/main_hl.gif" alt="" /></td>
                        <td ><img src="../../images/main_hl2.gif" alt="" /></td>
                        <td class="topNav"><span>学生列表</span></td>
                        <td><img src="../../images/main_hr.gif" alt="" /></td>
                    </tr>
                </table>
        </div>
    </div>
     <div class="middle_div">
        <div class="middle_left"></div>
        <div class="middle_middle">
            <div class="navigation" style="height:20px;">
                <span>首页&gt;学生管理&gt;学生列表</span>
                <div class="search_box">
                    <div class="div_serchCon">
                        <span style="color:#999">查询条件：</span>
                        <asp:DropDownList ID="ddlSerch" CssClass="ddlList "  runat="server"  >
                            <asp:ListItem Value="STU_CODE">学号</asp:ListItem>
                            <asp:ListItem Value="STU_GRADE">年级</asp:ListItem>
                            <asp:ListItem Value="STU_NAME">姓名</asp:ListItem>
                        </asp:DropDownList>
                    </div>
                    <div class="div_serchbox">
			            <asp:TextBox ID="txtKeywords" runat="server" CssClass="txtInput seacheContent"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" OnClick="btnSearchClick" OnClientClick="return check();" Text="搜 索" CssClass="btnSearch"  />
                    </div>
		        </div>
            </div>
            <div class="tools_box">
                <div class="tools_bar">
                      <a href='AddStudent.aspx'  class="tools_btn" ><span><b class="add">添加学生</b></span></a>
                    <a href="#"  class="tools_btn" onclick="checkAll(this);"><span><b class="checkAll">全选</b></span></a>
                    <asp:LinkButton runat="server" CssClass="tools_btn" ID="btn_Delete" OnClick="BatchDelete"  OnClientClick="return confirm( '确定要删除这些记录吗？ ');"><span><b class="delete">批量删除</b></span></asp:LinkButton>
                    <a href="InsertAll.aspx"  class="tools_btn" ><span><b class="add">批量导入</b></span></a>
                </div>
            </div>
            <div class="chooseClass">
                <span style="color:#999">选择学院</span>
                <asp:DropDownList ID="ddl_academy" CssClass="ddlList" runat="server" AutoPostBack="true" AppendDataBoundItems="True" onselectedindexchanged="ddl_academy_SelectedIndexChanged" >
                    <asp:ListItem Value="">全部学院</asp:ListItem>
                </asp:DropDownList>
                <span style="color:#999">选择班级</span>
                <asp:DropDownList ID="ddl_classes" CssClass="ddlList" OnTextChanged="ddl_classesChange" runat="server" AutoPostBack="true" ></asp:DropDownList>
                <span style="color:#999">请选择排序条件</span>
                <asp:DropDownList ID="ddlorder" CssClass="ddlList" OnTextChanged="ddlorderChange" runat="server"  AutoPostBack="true" >
                    <asp:ListItem Value="STU_CODE">学号</asp:ListItem>
                    <asp:ListItem Value="STU_GENDER">性别</asp:ListItem>
                    <asp:ListItem Value="STU_GRADE">年级</asp:ListItem>
                    <asp:ListItem Value="STU_NAME">姓名</asp:ListItem>
                </asp:DropDownList>
            </div>
            <div class="content_table">
                <table class="msgtable">
                    <asp:Repeater ID="RpList" runat="server" OnItemCommand="RpOperate">
                        <HeaderTemplate>
                            <tr>
                                <th>选择</th>
                                <th>姓名</th>
                                <th>性别</th>
                                <th>学号</th>
                                <th>用户名</th>
                                <th>密码</th>
                                <th>所属班级</th>
                                <th>年级</th>
                                <th>操作</th>
                            </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr id="stu_<%#Eval("STU_ID") %>">
                                <td><asp:CheckBox ID="CbChoose" CssClass="checkBox" runat="server" /><asp:HiddenField ID="hf_StudentId" Value='<%#Eval("STU_ID")%>' runat="server" /></td>
                                <td><%#Eval("STU_NAME")%></td>
                                <td><%#Eval("STU_GENDER").ToString().Trim()=="1"?"男":"女"%></td>
                                <td><%#Eval("STU_CODE")%></td>
                                <td><%#Eval("STU_USERNAME")%></td>
                                <td><%#Eval("STU_PASSWORD")%></td>
                                <td><%#new BLL.ClassService().getClass(Eval("STU_CLASSES").ToString())!=null?new BLL.ClassService().getClass(Eval("STU_CLASSES").ToString()).CLA_NAME:""%></td>
                                <td><%#Eval("STU_GRADE")%></td>
                                <td>
                                   
                                   <asp:LinkButton runat="server" ID="delStudent" CommandName="delStudent">删除</asp:LinkButton>
                                   |<a href='AddStudent.aspx?OPERATION=Modify&STU_ID=<%#Eval("STU_ID")%>'>修改</a>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
                 <center>
                    <div >
                        <span>共</span><label runat="server" id="lbPageAll"></label><span>条数据</span>
                        <span>分</span><label runat="server" id="lbPager"></label><span>页显示</span>
                        <asp:LinkButton ID="First" CommandName="First" runat="server" OnClick="PageClick">首页</asp:LinkButton>
                        <asp:LinkButton ID="Prev" CommandName ="Prev" runat="server" OnClick="PageClick">上一页</asp:LinkButton>
                        <span>第</span><label runat="server" id="lbIndexPage"></label><span>页</span>
                        <asp:LinkButton ID="Next" CommandName="Next" runat="server" OnClick="PageClick">下一页</asp:LinkButton>
                        <asp:LinkButton ID="Last" CommandName="Last" runat="server" OnClick="PageClick">尾页</asp:LinkButton>
                        <span>跳转到：</span>
                        <asp:DropDownList ID="DDLPager" AutoPostBack="true" runat="server" OnTextChanged="DDLpager_Change">
                        </asp:DropDownList> 
                    </div>
                </center>
            </div>
        </div>
        <div class="middle_right"></div>
    </div>
    <div class="Con_List" id="student_add">
        <div class="Con_top">
            <div class="Con_close" onclick="hideDiv('student_add')">X</div>
        </div>
        <div class="Con_middle">
            <table>
                <tr>
                    <td>
                        所属班级:
                    </td>
                    <td>
                        <asp:DropDownList runat="server" ID="ddl_Class_add" ></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        学生姓名:
                    </td>
                    <td>
                        <input type="text" runat="server" id="txt_studentName_add" />
                    </td>
                </tr>
                <tr>
                    <td>
                        性别:
                    </td>
                    <td>
                        <input type="radio" name="gender_add" runat="server" value="male" id="rd_male_add"  /><label>男</label>
                        <input type="radio" name="gender_add" runat="server" value="female" id="rd_female_add" /><label>女</label>
                    </td>
                </tr>
                <tr>
                    <td>
                        学号:
                    </td>
                    <td>
                        <input type="text"  runat="server"  id="txt_studentCode_add" />
                    </td>
                </tr>
                <tr>
                    <td>
                        用户名:
                    </td>
                    <td>
                        <input type="text"  runat="server"  id="txt_studentUsm_add" />
                    </td>
                </tr>
                <tr>
                    <td>
                        密码:
                    </td>
                    <td>
                        <input type="text"  runat="server" id="txt_studentPwd_add" />
                    </td>
                </tr>
                 <tr>
                    <td>
                         年级:
                    </td>
                    <td>
                        <input type="text"  runat="server" id="txt_studentGrade_add" />
                    </td>
                </tr>
            </table>
        </div>
        <div class="Con_foot">
            <asp:Button ID="Button1" runat="server" OnClick="AddStudent" OnClientClick="return checkAdd();" Text="确认添加" />
            <input type="button" value="取消" onclick="hideDiv('student_add')" />
        </div>
    </div>
    <div class="Con_List" id="student_edit">
        <div class="Con_top">
            <div class="Con_close" onclick="hideDiv('student_edit')">X</div>
        </div>
        <div class="Con_middle">
            <table>
                <tr>
                    <td>
                        所属班级:
                    </td>
                    <td>
                        <asp:DropDownList runat="server" CssClass="ddl_students_edit" ID="ddl_students_edit" ></asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        学生姓名:
                    </td>
                    <td>
                        <input type="text" runat="server" id="txt_studentName_edit" />
                    </td>
                </tr>
                <tr>
                    <td>
                        性别:
                    </td>
                    <td>
                        <input type="radio" name="gender_add" runat="server" value="male" id="rd_male_edit"  /><label>男</label>
                        <input type="radio" name="gender_add" runat="server" value="female" id="rd_female_edit" /><label>女</label>
                    </td>
                </tr>
                <tr>
                    <td>
                        学号:
                    </td>
                    <td>
                        <input type="text"  runat="server"  id="txt_studentCode_edit" />
                    </td>
                </tr>
                <tr>
                    <td>
                        用户名:
                    </td>
                    <td>
                        <input type="text"  runat="server"  id="txt_studentUsm_edit" />
                    </td>
                </tr>
                <tr>
                    <td>
                        密码:
                    </td>
                    <td>
                        <input type="text"  runat="server" id="txt_studentPwd_edit" />
                    </td>
                </tr>
                 <tr>
                    <td>
                         年级:
                    </td>
                    <td>
                        <input type="text"  runat="server" id="txt_studentGrade_edit" />
                    </td>
                </tr>
                <tr>
                    <td><input type="text" runat="server" id="stu_Id" style="display:none" /></td>
                </tr>
            </table>
        </div>
        <div class="Con_foot">
            <asp:Button ID="Button2" runat="server" OnClick="AddStudent" OnClientClick="return checkedit();" Text="确认修改" />
            <input type="button" value="取消" onclick="hideDiv('student_edit')" />
        </div>
    </div>
    </form>
</body>
</html>
